镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Split RunCommandTests by area so the test project builds again [patch] - #154

Open
matt-edmondson wants to merge 1 commit into
mainfrom
fix-ca1506-test-split
Open

matt-edmondson wants to merge 1 commit into
mainfrom
fix-ca1506-test-split

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #152

What

RunCommandTests was coupled with 98 types, over CA1506's limit of 96. Because of that, RunCommand.Test failed to build on main and every CI run was red. This PR moves three areas into classes of their own and changes no test bodies:

  • OverlayPathTests: overlay PATH resolution, CanExecute, ResolveOnSearchPath
  • OutputDecodingTests: byte order marks and strict decoding
  • LineOutputHandlerRunTests: LineOutputHandler reused across runs

Three helpers are shared across classes and are now internal (CreateDirectoryForTest, SkipOnWindows, GetEmitFileBytesCommand). Each field moved with the tests that use it. Nothing is suppressed.

Verification (Linux, .NET 10.0.403)

  • Before: dotnet build RunCommand.Test fails with CA1506: 'RunCommandTests' is coupled with '98' different types
  • After: dotnet build succeeds with analyzers on and 0 warnings
  • ktsu.RunCommand.Test: 111 total, 108 passed, 3 skipped, 0 failed. That is the same count the issue reported with analyzers off.

After this merges, #150 and #151 should pass once they are rebased.


Generated by Claude Code

RunCommandTests had grown to 98 coupled types, over CA1506's limit of 96,
so RunCommand.Test failed to build on main and CI was red. Move the
overlay PATH, output decoding, and LineOutputHandler run tests into
their own classes. No test changes behaviour.

Fixes #152

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5GEJNk1TZFgDdUPFX
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants